package com.fhz.day003;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableArrayMap;
import androidx.databinding.ViewDataBinding;

import com.fhz.day003.databinding.ActivityMain2Binding;

import java.util.ArrayList;
import java.util.List;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_main2);
        User user = new User("小明", "15");
        ActivityMain2Binding activityMain2Binding = DataBindingUtil.setContentView(this, R.layout.activity_main2);
        activityMain2Binding.setUser(user);

        List<String> list = new ArrayList<>();
        list.add("小花");
        activityMain2Binding.setList(list);
        activityMain2Binding.setActivity(this);



    }

    public void send(View view){
        Toast.makeText(this, "哈哈", Toast.LENGTH_SHORT).show();
    }

    public void post(String s){
        Toast.makeText(this, s, Toast.LENGTH_SHORT).show();
    }

}